package com.test.springboot.listener;

import com.test.springboot.config.UserStreams;
import com.test.springboot.model.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.messaging.handler.annotation.Payload;
import org.springframework.stereotype.Component;

/**
 * @author chenxubing
 * @version $Id: UserListener.java, v 0.1 2018-11-09 3:22 PM chenxubing Exp $$
 */
@Component
@Slf4j
public class UserListener {
    @StreamListener(UserStreams.INPUT)
    public void onReceive(@Payload User user) {
        log.info("receive user: {}", user);
    }
}